package com.example.module4

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import kotlinx.android.synthetic.main.activity_main4.*
import kotlin.math.log

/**
 *  测试类
 *  @author lfc-LFC
 *  created at 2021/3/29 16:47
 */
@Route(path = "/module4/MainActivity4")
class MainActivity4 : AppCompatActivity() {

    @JvmField
    @Autowired(name = "strName1")
    var strNames = ""

    @JvmField
    @Autowired
    var showType = 1

//    @Autowired
//    private lateinit var objDataTest: TestBeans2;

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main4)
// TODO: 2021/3/30 必须使用ARouter.getInstance().inject(this);，并且要在参数调用之前传参，否则参数会获取不到值
        ARouter.getInstance().inject(this)
        initView()
    }

    private fun initView() {
        Log.d("--lfc", "strName: $strNames showType=$showType ")
        tv_show.setText("strName: $strNames showType=$showType ")
    }
}